//Changes map orders for units to follow.

//Map Orders
//#0 None – No orders

//#1 Defend 1 – Land units will choose defend 1 over other hexes when an objective is threatened and on the defensive.

//#2 Defend 2 - Land units will choose defend 2 over defend 1 when an objective is threatened and on the defensive.

//#3 Small Garrison + Air Garrison - Puts a small garrison and any air unit available on this hex

//#4 Air Superiority Garrison – This allows you to hold an air superiority group at a position and not allow it to move unless it is threatened to be overrun. It will not pick up scripting orders or move to areas that need air support. An example of its use is keeping the RAF in England during the Battle of France to limit their exposure to be overrun.

//#5 Air Superiority Interceptor Defense  - Air garrison locations vs strategic bombing. Air units will stay for 3 turns defending the area vs strategic bombardment within their range.

//#6 Bomber Garrison - As air superiority garrison but for bombers

//#7 Air Attack – This tells the air forces to start continuous land air strikes vs land units within the tactical range of where the order is placed. It can be used to prepare for an invasion. The Normandy invasions are an example of where an air attack order in France is useful for the Allies.

//#8 Raid Supply – This sets locations where submarine groups interdict ports to damage their supply. Raid hexes need to be within 4 hexes of enemy ports. This value is the default range. The range can be changed in the editor.

//#9 Raid Merchant – This sets up locations where submarines can raid production convoys. Subs will pick the safest of these locations to attack convoys. 

//Note: Place raids in as few hexes as possible to improve game speed.

//#10 Invade – Hexes choose for invasion. The A.I. will keep looking for new hexes to invade for 3 turns before it returns to base if all invasion hexes are filled.

//Note: When fleets with invasion orders arrive at their waypoint they will look for invasion order hexes to move to and invade within tactical range.

//#11 Garrison Large - Large corps and armies go to large garrison positions before any other map order. They will only retreat if the enemy has a large advantage in combat factors.

//#12 Garrison Armor - Armor and mechanized go to armor garrison positions before any other map order. They will only retreat if the enemy has a large advantage in combat factors.

//#13 Garrison Small - Small corps, small armies, and divisions go to small garrison positions before any other map order. They will only retreat if the enemy has a large advantage in combat factors.

//#14 Retreat – Orders all units within tactical range to retreat to a supply source from this area. This is best used to prevent the A.I. from being encircled at key locations.

//#16 Small Naval Patrol - A.I. will send 2 naval groups to stay at this location attempting to intercept enemy fleets.

//#17 Medium Naval Patrol - A.I. will send 4 naval groups to stay at this location attempting to intercept enemy fleets.

//#18 Large Naval Patrol - A.I. will send 6 naval groups to stay at this location attempting to intercept enemy fleets.

//#19 Garrison Headquarters - Headquarters go to small garrison positions before any other map order. They will only retreat if the enemy has a large advantage in combat factors.

//#20 Hold Large - Large corps and armies go to large garrison positions before any other map order.

//#21 Hold Armor - Armor and mechanized go to armor garrison positions before any other map order.

//#22 Hold Small - Small corps, small armies, and divisions go to small garrison positions before any other map order.

//Note: Units in hold locations never retreat from these order positions

//#24 Battleground Port – This port is designated to hold battle group and support group units only.

//#25 Carrier Port – This port is designated to hold carrier groups and support groups only.

//#26 Submarine Port – This port is the priority choice for submarines to base in.

//#27 Offensive Large - Large corps and armies go to large offensive garrison positions to prepare for big offensives. They are similar to holds except they are occupied last in the order of garrisons orders.

//#28 Offensive Armor - Armor and mechanized go to armor offensive garrison positions to prepare for big offensives. They are similar to holds except they are occupied last in the order of garrisons orders.

//#29 Hold Ships - All naval units within tactical range will stay in the area as long as the order is there resupplying via tankers

//$30 Any Port - This is a port that holds all kinds of ships combining carrier and surface ports

//#31 Ignore - A.I. will not set map orders for this location within the tactical range. It can only be removed with a script.

//trueAxis - sets hex as Axis objective

//trueAllies - sets hex as Allied objective

//Main port swaps depending on what they control
//Start with making San Francisco the default
$ChangeOrder
if_Date=1/1/1943
actionCountry=1
lifespan=continuous
//San Francisco
xyArea=93,6,0
xyArea=95,35,0
xyArea=95,50,0
xyArea=59,55,0
xyArea=166,68,0
xyArea=194,83,30
$End

$ChangeOrder
if_Date=1/1/1943
actionCountry=1
lifespan=continuous
//All of Hawaii
xyControl=166,68,Allies
xyControl=168,68,Allies
xyControl=169,66,Allies
xyArea=93,6,0
xyArea=95,35,0
xyArea=95,50,0
xyArea=59,55,0
xyArea=166,68,30
xyArea=194,83,0
$End

$ChangeOrder
if_Date=1/1/1943
actionCountry=1
lifespan=continuous
//Sydney
xyControl=93,6,Allies
//All of Hawaii
xyControl=166,68,Allies
xyControl=168,68,Allies
xyControl=169,66,Allies
//Sydney, Truk, Rabaul, Manilla
xyArea=93,6,30
xyArea=95,35,0
xyArea=95,50,0
xyArea=59,55,0
xyArea=166,68,0
xyArea=194,83,0
$End

$ChangeOrder
if_Date=1/1/1943
actionCountry=1
lifespan=continuous
//Rabaul
xyControl=95,35,Allies
//All of Hawaii
xyControl=166,68,Allies
xyControl=168,68,Allies
xyControl=169,66,Allies
//Sydney, Truk, Rabaul, Manilla
xyArea=93,6,0
xyArea=95,35,30
xyArea=95,50,0
xyArea=59,55,0
xyArea=166,68,0
xyArea=194,83,0
$End


$ChangeOrder
if_Date=1/1/1943
actionCountry=1
lifespan=continuous
//Truk
xyControl=95,50,Allies
//All of Hawaii
xyControl=166,68,Allies
xyControl=168,68,Allies
xyControl=169,66,Allies
//Sydney, Truk, Rabaul, Manilla
xyArea=93,6,0
xyArea=95,35,0
xyArea=95,50,30
xyArea=59,55,0
xyArea=166,68,0
xyArea=194,83,0
$End

$ChangeOrder
if_Date=1/1/1943
actionCountry=1
lifespan=continuous
//Manilla
xyControl=59,55,Allies
//All of Hawaii
xyControl=166,68,Allies
xyControl=168,68,Allies
xyControl=169,66,Allies
//Sydney, Truk, Rabaul, Manilla
xyArea=93,6,0
xyArea=95,35,0
xyArea=95,50,0
xyArea=59,55,30
xyArea=166,68,0
xyArea=194,83,0
$End

//Change Singapore to Allied Any Port
$ChangeOrder
if_Date=1/1/1943
actionCountry=1
lifespan=tillTrigger
//Remove Bombay, activate Singapore
xyControl=41,41,Allies
xyArea=6,61,0
xyArea=41,41,30
$End

//Change To Bombay if Colombo is taken
//Activate Pearl Harbor
$ChangeOrder
if_Date=1/1/1943
actionCountry=1
lifespan=tillTrigger
xyArea=166,68,30
xyArea=6,61,30
$End

//Remove air holds in USA 
//Activate Pearl Harbor
$ChangeOrder
if_Date=6/21/1942
actionCountry=3
lifespan=tillTrigger
xyArea=194,83,13
xyArea=194,94,13
xyArea=195,80,0
xyArea=195,91,0
xyArea=196,77,13
xyArea=196,79,0
xyArea=197,75,13
$End

//#############
//Retake Hawaii
//#############

//Turn on and off patrols around Pearl Harbor
//If Japan controles it
$ChangeOrder
if_Date=1/1/1943
//Pearl Harbor
xyControl=166,68,Axis
//West coast USA and Canada
xyControl=193,95,Allies
xyControl=194,94,Allies
xyControl=194,83,Allies
xyControl=196,77,Allies
xyControl=197,75,Allies
actionCountry=3
lifespan=tillTrigger
//set large surface patrol
xyArea=168,69,18
xyArea=169,68,18
$End

//Turn on and off patrols around Pearl Harbor
//If Japan controles it
$ChangeOrder
if_Date=7/14/1943
//Pearl Harbor
xyControl=166,68,Allies
//West coast USA and Canada
xyControl=193,95,Allies
xyControl=194,94,Allies
xyControl=194,83,Allies
xyControl=196,77,Allies
xyControl=197,75,Allies
actionCountry=3
lifespan=tillTrigger
//turn off all patrols
xyArea=168,69,0
xyArea=169,68,0
$End

//Change air holds in Australia to regular air orders
$ChangeOrder
if_Date=7/14/1943
actionCountry=3
lifespan=tillTrigger
xyArea=88,22,6
xyArea=93,17,6
$End

//Add Allied air holds in bases as time passes
$ChangeOrder
if_Date=5/1/1942
actionCountry=3
lifespan=tillTrigger
//Henderson Field
xyArea=104,31,3
//Pago Pago
xyArea=136,29,3
$End

//Add Allied air holds in bases as time passes
$ChangeOrder
if_Date=6/1/1942
actionCountry=3
lifespan=tillTrigger
//Noumea
xyArea=112,19,3
//Namuga
xyArea=106,29,3
$End

//Add Allied air holds in bases as time passes
$ChangeOrder
if_Date=7/1/1942
actionCountry=3
lifespan=tillTrigger
//Port Vila
xyArea=113,22,3
//Espirito Santo
xyArea=112,25,3
$End

//Add Allied air bases in Philippines
$ChangeOrder
if_Date=3/1/1943
actionCountry=3
lifespan=tillTrigger
xyArea=61,58,4
xyArea=61,59,6
xyArea=59,57,6
xyArea=63,53,6
$End

//USSR removes all offensive holds
$ChangeOrder
if_Date=7/1/1945
actionCountry=4
lifespan=tillTrigger
xyArea=57,94,0
xyArea=58,94,0
xyArea=58,95,0
xyArea=59,94,0
xyArea=59,95,0
xyArea=60,95,0
xyArea=60,96,0
xyArea=65,98,0
xyArea=66,98,0
xyArea=67,97,0
xyArea=68,96,0
xyArea=68,97,0
xyArea=69,96,0
xyArea=70,95,0
xyArea=70,96,0
xyArea=71,87,0
xyArea=71,88,0
xyArea=71,93,0
xyArea=71,94,0
xyArea=72,89,0
xyArea=72,90,0
xyArea=74,90,0
xyArea=74,94,0
$End

//Change orders when 2 units in PortMoresby
$ChangeOrder
if_Date=3/29/1942
actionCountry=3
//USA corps arrives
landUnitInRadius=88,31,2,1,Allies
lifespan=tillTrigger
xyArea=88,32,11
xyArea=88,31,20
$End

//Remove Port Morsby holds when area is clear
$ChangeOrder
if_Date=6/1/1942
actionCountry=3
//USA corps arrives
landUnitInRadius=85,45,0,5,Axis
lifespan=tillTrigger
xyArea=89,31,0
xyArea=88,31,0
$End